import { RunningStatus } from '@/constants/knowledge';

// knowledge base
export interface IKnowledge {
  avatar?: any;
  chunkNum: number;
  createAt: string;
  createTime: number;
  createBy: string;
  description: string;
  docNum: number;
  datasetId: string;
  name: string;
  parserConfig: Parserconfig;
  parserId: string;
  permission: string;
  similarityThreshold: number;
  status: string;
  orgId: string;
  tokenNum: number;
  updateDate: string;
  updateAt: number;
  vectorSimilarityWeight: number;
}

export interface Parserconfig {
  fromPage: number;
  toPage: number;
}

export interface IKnowledgeFileParserConfig {
  chunkTokenNum: number;
  layoutRecognize: boolean;
  pages: number[][];
  taskPageSize: number;
}
export interface IKnowledgeFile {
  chunkNum: number;
  createAt: string;
  createBy: string;
  documentId: string;
  datasetId: string;
  location: string;
  name: string;
  parserId: string;
  processBeginAt?: any;
  processDuation: number;
  progress: number; // parsing process
  progressMsg: string; // parsing log
  processStatus: RunningStatus; // parsing status
  size: number;
  sourceType: string;
  status: number; // enabled
  thumbnail?: any; // base64
  tokenNum: number;
  type: string;
  updateAt: string;
  updateTime: number;
  parserConfig: IKnowledgeFileParserConfig;
}

export interface ITenantInfo {
  asrId: string;
  embdId: string;
  img2txtId: string;
  llmId: string;
  orgName: string;
  parserIds: string;
  role: string;
  orgId: string;
  chatId: string;
  speech2textId: string;
  ttsId: string;
}

export interface IChunk {
  status: number; // Whether to enable, 0: not enabled, 1: enabled
  segmentId: string;
  content: string;
  documentId: string;
  docName: string;
  imgId: string;
  importantKwd: any[];
  positions: number[][];
}

export interface ITestingChunk {
  chunkId: string;
  contentLtks: string;
  contentWithWeight: string;
  docId: string;
  docName: string;
  imgId: string;
  importantKwd: any[];
  datasetId: string;
  similarity: number;
  termSimilarity: number;
  vector: number[];
  vectorSimilarity: number;
  highlight: string;
}

export interface ITestingDocument {
  count: number;
  docId: string;
  docName: string;
}

export interface ITestingResult {
  chunks: ITestingChunk[];
  documents: ITestingDocument[];
  total: number;
}
